package kr.saeildamil.androidStudy_second.brservice;

import kr.saeildamil.androidStudy_second.R;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;

public class MusicServiceTest extends Activity implements OnClickListener{

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.ch29and30_musicservicetest);
		findViewById(R.id.music_start).setOnClickListener(this);
		findViewById(R.id.music_stop).setOnClickListener(this);
	}
	
	@Override
	public void onClick(View v) {
		Intent intent = new Intent(this,MusicService.class);	
		switch(v.getId()){
		case R.id.music_start:
			startService(intent);		
			break;
		case R.id.music_stop:
			stopService(intent);
			break;
		}
	}

}
